/*
{
"状态":1,
"名称":"获取-字典资料",
"作者":"陈泽椿",
"创建时间":"2018-07-17",
"功能":"获取-数据库表列资料",
"log": [
	{"date":"06-01" , "dev" :"hzhh" , "content" : ""}
]
}
*/

declare @sql varchar(max)
declare @table_key varchar(100)
declare @colname varchar(100)
declare @where varchar(max)
set @table_key = '{table_key}'
set @colname = '{colname}'
set @where = ''

if (@table_key <>'')
begin
	set @where += ' and table_key = '+@table_key
end
if (@colname <>'')
begin
	set @where += ' and (colname like ''%'+@colname+'%'' or col_des like ''%'+@colname+'%'')'
end
set @sql = '
select * from y_columns where 1=1 {where} '
set @sql =replace(@sql,'{where}',@where)

exec(@sql)
